package com.zerui.manager.common.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.core.conditions.update.Update;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.SuperBuilder;
import nonapi.io.github.classgraph.json.Id;

import javax.validation.constraints.NotNull;

/**
 * @Author wh
 * @create_time 2023-08-23 15:28
 */
@Getter
@Setter
@ToString(callSuper = true)
@SuperBuilder
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor(access = AccessLevel.PROTECTED)
public abstract class BaseMetaDataWithIdEntity extends BaseMetaDataWithUpdaterEntity {

    @ApiModelProperty("主键，无业务含义")
    @NotNull(groups = Update.class)
    @Id
    private Long id;

    /**
     * 逻辑删除:0=未删除,1=已删除
     */
    @JsonIgnore
    @TableField(fill = FieldFill.INSERT)
    @TableLogic
    private Boolean isDelete;

}
